import java.util.Scanner;
public class J1510 {
    public static int sum(int n){
        if(n < 10){
            return n;
        }else{
            return ((n % 10) + sum(n / 10));
        }
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        System.out.println(sum(n));
    }
}
